home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / BBS / MUBBS / MUBBS etc.cpt / Module Source / E-mail / EmailOnLogin.c < prev    next >
Text File  |  1991-11-22  |  3KB  |  102 lines

  1. /* *********************************************************************************
  2.      
  3.       MODULE:        EmailOnLogin Module
  4.       
  5.      DESCRIPTION:    This EmailOnLogin Module is a simple module for MUBBS, the
  6.                      Multi-User Bulliten Board System Software.
  7.                      
  8.      AUTHOR:        Noam Freedman
  9.      
  10.      Copyright © 1990 by Noam Freedman. Portions are also Copyright Symantec Corp.
  11.  
  12.      This program source code and it's compiled version IS NOT IN THE
  13.      PUBLIC DOMAIN ! Please read the "COPYRIGHT NOTICE / NMF" file for details
  14.      regarding use of this program source code and it's compiled version.
  15.      
  16.      Revision History:
  17.      ============================================================
  18.      10/20/91 - Started programming
  19.      11/ 4/91 - Edited for release
  20.      ============================================================
  21.      
  22.  
  23.     ******************************************************************************** */
  24.  
  25. #define INMAIN
  26.  
  27. #include "MUBBS Module.h"
  28. #include "Email.h"
  29. #include <SetUpA4.h>
  30.  
  31.  
  32. pascal void main (mode1,G1,P1) /* called from the main routines, and what mode to be in */
  33. int mode1;
  34. struct GS *G1; /* we point to the "global" struct in the Main Module here */
  35. Ptr P1; /* we ignore this pointer, we do not use it at all */
  36. {
  37. Handle temph;
  38. float version = 0.5; /* what version of MUBBS you are compatable with IE: .5 and above */
  39. RememberA0(); SetUpA4(); /* This sets up the A4 register to access our globals */
  40. asm { _RecoverHandle }; asm {move.l a0,temph}; HLock(temph); /* locks our module, do this ! */
  41.  
  42. G=G1; /* This MUST be the first thing you do in main only, it sets up the struct globals */
  43. mode[u]=mode1; /* set up our mode so that you can read it anywhere */
  44.  
  45. switch (mode[u]) { /* any un-handled modes return error from this module */
  46.     case 2:
  47.         dostuff();
  48.         G->moduleresult=0;
  49.         break;
  50.     case 98:
  51.         versionck(version); /* just return after this call, don't modify anything */
  52.         break;        
  53.     case 0:
  54.         strcpy (G->programmer,"Noam Freedman"); /* show the programmer's name up to 20 chars*/
  55.         G->moduleresult=0; /* this was also a init call if we need close call put 99 here */
  56.         break;
  57.     default:
  58.         G->moduleresult=1; /* return bad code */
  59.     };
  60.  
  61. HUnlock(temph); /* unlocks this module, do this ! */
  62. RestoreA4(); /* call this when you are all done */
  63. }
  64.  
  65.  
  66. dostuff()
  67. {
  68. char pad[100]; /* this is a fix for a problem */
  69. int a = 0;
  70. int b = 0;
  71. int num;
  72. char pad2[100]; /* this is a fix for a problem */
  73. struct LoadStruct S;
  74. FILE *fp_headers;
  75.  
  76. if (!G->online[u]) { return; } /* do this check so we can log out if hang up */
  77.  
  78.  
  79. module (3,"check_email",&S);
  80.  
  81. if (S.result == 21)
  82.     {
  83.     send("]You have no mail waiting.]");
  84.     return;
  85.     }
  86.  
  87. if (S.result != 0 && S.result != 20) return;
  88.  
  89. send("]*************************]");
  90. send( "*     YOU HAVE MAIL !   *]");
  91. send( "*************************]");
  92. if (!cmd1("]Would you like to go to the Mail Menu now (Y/N)? ") )  return;
  93.     send(G->CR[u]);
  94.     if (G->input[u] == 'Y')
  95.         {
  96.         module (2,"check_for_email",0L);
  97.         send("]]Continuing with log on...]]");
  98.         }
  99.  
  100. }
  101.  
  102.